import {AtTabBar} from "taro-ui";
import * as Taro from '@tarojs/taro'

import './index.scss'

interface Props {
  current: number
}
const TabBar = ({current}: Props) => {

  return (
      <AtTabBar
        fixed
        current={current}
        tabList={[
          { title: '首页', iconType: 'home'},
          { title: '个人中心', iconType: 'user' },
        ]}
        onClick={(i) => {
          const urls = [
            '/pages/view/main/index',
            '/pages/view/me/index'
          ]
          Taro.switchTab({
            url: urls[i]
          })
        }}
      />
  )
}

export default TabBar
